<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>

<%

RequestUtil ru=new RequestUtil(request);

int riId=Integer.parseInt(ru.getParameter("riId","0"));

%>


<script type="text/javascript">
<!--
	var riId="<%=riId%>";
	
	//删除岗位
	function deljob(jobid){
	
		$.post(
				"<%=root %>/memberBackend/riJobDel.do",
				{jobid:jobid,riId:riId},
				function(data){	
				$("#joblist").load("ri_job_list.jsp",{riId:riId});
		});

	}
//-->
</script>

<%

	//获得岗位列表 
	List jobList=new ArrayList();
	
	if(riId!=0){
		
		//如果有指定的招聘信息编号，获得招聘信息对象，获得岗位列表
		
		RecruitmentinformationService ris=new RecruitmentinformationServiceImpl();
	
		Recruitmentinformation ri=new Recruitmentinformation(riId); 
		
		ri=ris.getOneRecruitmentinformation(ri); //获得招聘信息对象
		
		jobList=new ArrayList(ri.getJoblistSet());
		
	}else{
		
		//如果没有招聘信息编号，从sesession 中获得岗位列表
		jobList=(List)ru.getSessionObject(RecruitmentinformationService.JOBLLIST_IN_SESSION, new ArrayList());
	}

%>


<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" id="a1">

	<%
	
		if(jobList!=null && jobList.size()>0){
			
			Joblist job=null;
			
			for(int i=0;i<jobList.size();i++){
				
				job=(Joblist)jobList.get(i);
				
				String type=CodeMap.jobType.get(job.getJobtype()).toString();
				
				int jobId=i;
				
				if(riId!=0) jobId=job.getId(); 
	%>
	

    <tr>
      <td height="28" colspan="2" align="right" class="td_top">
      <input type="button" name="button4" id="button" value="删除" onclick="deljob('<%=jobId %>');"/>
        &nbsp;&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="100" height="28" align="right">岗位类型：</td>
            <td><label><%= type +"-"+ job.getJobtypedesc() %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">岗位名称：</td>
            <td><label><%=job.getJobname() %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">工作地点：</td>
           <td><label><%=job.getJobaddress() %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">工作经验：</td>
            <td><label><%=CodeMap.injobTime.get(job.getWorkExperience()).toString()  %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">学历要求：</td>
            <td><label><%=CodeMap.edu.get(job.getSchoolage()).toString()  %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">招聘人数：</td>
            <td><label><%=job.getJobnumber() %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">月薪范围：</td>
            <td><label><%=CodeMap.income.get(job.getJobpay()).toString()  %> 元</label></td>
          </tr>
          <tr>
            <td height="28" align="right">发布日期：</td>
            <td><label><%=job.getCreatedate() %></label></td>
          </tr>
          <tr>
            <td height="28" align="right">截止日期：</td>
            <td><label><%=job.getEnddate() %></label></td>
          </tr>
      </table></td>
      <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" valign="top">岗位描述：</td>
            <td><textarea name="textarea3" id="textarea" cols="40" rows="14"><%= job.getSummary() %></textarea></td>
          </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td height="28" align="left"  class="td_dashed"></td>
      <td valign="top"  class="td_dashed">&nbsp;</td>
    </tr>
    <%
			}
		}
	%>
    
   
  </table>
